package com.seal.yoyoshop.service.impl;

import com.seal.yoyoshop.bin.Top;
import com.seal.yoyoshop.dao.TopDao;
import com.seal.yoyoshop.dao.impl.TopDaoImpl;
import com.seal.yoyoshop.service.TopService;

import java.util.List;

public class TopServiceImpl implements TopService {

    private TopDao topDao = new TopDaoImpl();

    @Override
    public List<Top> getTopListByGoodId(int goodsId) {
        List<Top> topList = topDao.selectTopListByGoodsId(goodsId);
        return topList;
    }

    @Override
    public boolean addTop(Top top) {
        boolean isSuccess = topDao.addTopByTop(top);
        return isSuccess;
    }

    @Override
    public boolean deleteTop(Top top) {
        boolean isSuccess = topDao.deleteTopByTop(top);
        return isSuccess;
    }
}
